# Copyright 2016-2020 Daniel 'grindhold' Brendle
#
# This file is part of panlateral.
#
# panlateral is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later
# version.
#
# panlateral is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with panlateral.
# If not, see http://www.gnu.org/licenses/.
project('rainbow-lollipop', 'vala', 'c')

vapi_dir = meson.current_source_dir()+'/vapi'
add_project_arguments(['--vapidir', vapi_dir], language: 'vala')

pkgconfig = import('pkgconfig')

glib = dependency('glib-2.0')
gtk = dependency('gtk+-3.0')
clutter = dependency('clutter-1.0')
clutter_gtk = dependency('clutter-gtk-1.0')
webkit2gtk = dependency('webkit2gtk-4.0')
webkit2gtk_ext = dependency('webkit2gtk-web-extension-4.0')
gee = dependency('gee-0.8')
zmq = meson.get_compiler('c').find_library('libzmq')
math = meson.get_compiler('c').find_library('m')
sqlite3 = dependency('sqlite3')
httpseverywhere = dependency('httpseverywhere-0.8')

rl_sources = [
    'src/track.vala',
    'src/database.vala',
    'src/empty_track.vala',
    'src/alaia.vala',
    'src/history_track.vala',
    'src/tracklist.vala',
    'src/nodes.vala',
    'src/site_node.vala',
    'src/download_node.vala',
    'src/config.vala',
    'src/ipc.vala',
    'src/ipc_protocol.vala',
    'src/session_select.vala',
    'src/authentication_dialog.vala',
    'src/history.vala',
    'src/searchengine.vala',
    'src/search_widget.vala',
    'src/error_node.vala',
    'src/application_states.vala',
    'src/config_dialog.vala',
    'src/context_menu.vala',
    'src/input_handlers.vala',
    'src/loading_indicator.vala',
    'src/focus.vala',
    'src/trackwebview.vala'
]

rl_deps = [
    math, glib, gtk, clutter, clutter_gtk, webkit2gtk, gee, zmq, sqlite3, httpseverywhere
]

rl_ext_sources = [
    'src/alaia_extension.vala',
    'src/ipc_protocol.vala'
]

rl_ext_deps = [
    math, glib, webkit2gtk_ext, gee, zmq
]

rl_ext = shared_library('rainbow-lollipop-extension', rl_ext_sources, 
                        dependencies: rl_ext_deps, 
                        vala_args:['--pkg', 'libzmq']
)
rl = executable('rainbow-lollipop', rl_sources, 
                        dependencies: rl_deps, 
                        vala_args:['--pkg', 'libzmq'],
                        c_args: ['-DGETTEXT_PACKAGE="rainbow-lollipop"']
)

